wayland: Don't clear revents until we've checked for G_IO_HUP
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 9 Jul 2013 22:35:06 +0000 (18:35 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 9 Jul 2013 22:38:32 +0000 (18:38 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=703892

gdk/wayland/gdkeventsource.c

index cb335bd2c1029aa18378841f7813ea458263e5a0..4bcae9b285f72128d5181e2ffd967b7ecb2f7b17 100644 (file)
@@ -150,12 +150,12 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
 
   display_wayland = GDK_WAYLAND_DISPLAY (display);
   source = (GdkWaylandEventSource *) display_wayland->event_source;
+
   if (source->pfd.revents & G_IO_IN)
-    {
-       wl_display_dispatch(display_wayland->wl_display);
-       source->pfd.revents = 0;
-    }
+    wl_display_dispatch (display_wayland->wl_display);
 
   if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
     g_error ("Lost connection to wayland compositor");
+
+  source->pfd.revents = 0;
 }